<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script type="text/javascript">
    function page(n,s){
        $("#pageNo").val(n);
        $("#pageSize").val(s);
        $("#searchFormDict").submit();
        return false;
    }
    function changeFun(){
        $("#administration").val("");
        var arr = $("select[name='adminis']").val();
        $("#administration").val(arr);
    }
    function trFun(id,pid,vid,bedNo) {
        $("#orderId").val(id);
        $("#patientId").val(pid);
        $("#visitId").val(vid);
        $("#bedNo").val(bedNo);
    }
    function bottleLabelPrint() {
        var bedNo = $("#bedNo").val();

        if(bedNo=="" ){
         toastr.error('请先选择要打印的相应病人的医嘱瓶签！');
         }else{
            var visitId = $("#visitIds").val();

            alert(visitId);
        printPdf("${ctx}/orders/orders/ordersBottleLabelPrint?bedNo="+bedNo+"&visitId="+visitId)
      }
    }
    <%--$(function(){--%>
        <%--var temp = '${orders.type}'.split(',');--%>
        <%--for(var i=0;i<temp.length;i++) {--%>
            <%--$(':checkbox[name="type"][value="' + temp[i] + '"]').prop('checked', true)--%>
        <%--}--%>

        <%--$('#searchFormDict input[name=repeatIncaditor]').click(function(){--%>
            <%--$(this).siblings('input[name=repeatIncaditor]').each(function(){--%>
                <%--this.checked=false;--%>
            <%--})--%>
            <%--$('#btnSubmit').click();--%>
        <%--})--%>

        <%--$('#searchFormDict input[name=type]').click(function(){--%>
            <%--$('#btnSubmit').click();--%>

        <%--});--%>

    <%--})--%>
</script>
<div class="app">
    <section class="layout">
        <section class="main-content col-lg-5">
            <div class="content-wrap" id="leftCenterDiv">
                <div class="wrapper" style="bottom: 50px;">
                    <ul class="nav nav-tabs">
                        <li><a href="#" onclick="loadDiv('nurseIndexDiv','${ctx}/nurse/index')">床位列表</a></li>
                        <li  class="active">
                            <a href="#" onclick="loadDiv('nurseIndexDiv','${ctx}/orders/orders/findOrdersBottleLabel')">医嘱瓶签</a>
                        </li>
                    </ul>

                    <%--左侧住院病人列表--%>
                    <section class="panel panel-default">
                        <div class="panel-body">
                            <div class="table-responsive no-border">
                                <div class="datatable-top">
                                    <div class="pull-left">
                                        <%--住院病人--%>
                                        <form:form id="searchFormDict" modelAttribute="orders" onsubmit="return loadDivForm('mainCenterDiv','searchFormDict','${ctx}/orders/orders/findOrdersBottleLabel');" method="post" class="form-inline">

                                            <label>床位号 ：</label><form:input path="bedNo" id="bedNo" htmlEscape="false" maxlength="50" class="form-control" />

                                            <form:hidden path="administration" id="administration"/>
                                            &nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
                                            &nbsp;<input  class="btn btn-primary" onclick="bottleLabelPrint()" type="button" value="打印"/>
                                        </form:form>
                                    </div>
                                </div>

                                <%--住院病人列表--%>
                                <div class="container-fluid">
                                    <table id="contentTable1" class="table table-bordered mg-t datatable" checkbox="true">
                                        <thead>
                                        <tr>
                                            <%--<th><input type="checkbox" id="checkbox"></th>--%>
                                            <th>床号</th>
                                            <th>姓名</th>
                                            <th>年龄</th>
                                            <th>性别</th>
                                            <th>身份证号</th>
                                            <th>住院号</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <c:forEach items="${listp}" var="p" varStatus="coun">
                                        <tr onclick="loadDiv('rigthCenterDiv','${ctx}/orders/orders/findOrdersBottle?visitId=${p.id}')">

                                            <td> ${p.bedno}</td>
                                            <td> ${p.name} </td>
                                            <td> ${p.age} </td>
                                            <td> ${fns:getDictLabel(p.sex, 'SEX_DICT', '')} </td>
                                            <td> ${p.id_no} </td>
                                            <td> ${p.visit_no} </td>
                                          <input type="hidden" value="${p.id}" id="visitIds">
                                        </tr>
                                        </c:forEach>
                                    </table>
                                    <div class="pagination">${page}</div>
                                </div>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </section>


        <%--右侧医嘱瓶签列表--%>
        <section class="main-content col-lg-8">
            <div class="content-wrap" id="rigthCenterDiv">

            </div>
        </section>
    </section>
</div>

